/*默认样式*/

* {
  margin: 0;
  padding: 0;
}

ol, ul {
  list-style: none;
}
ul li {
  list-style: none;
}

body {
  min-height: 100%;
  width: 100%;
  perspective: 800px;
  overflow: hidden;
}

/*外层盒子*/

#cube {
  height: 200px;
  width: 200px;
  margin: 250px auto;
  animation: rotate1 5s linear infinite;
  transform-style: preserve-3d;
  transform-origin: center center 0;
}

#cube ul {
  width: 200px;
  height: 200px;
  position: relative;
}

#cube ul img {
  width: 200px;
  height: 200px;
}

#cube ul li {
  width: 200px;
  height: 200px;
  position: absolute;
  transition: 2s;
}











/*内层盒子*/

#cube ol {
  width: 200px;
  height: 200px;
}

#cube ol img {
  width: 100px;
  height: 100px;
}

#cube ol li {
  width: 100px;
  height: 100px;
  position: absolute;
}

#cube ol li:nth-child(1) {
  left: 50px;
  top: 50px;
  /* opacity: .7; */
  transform: translateZ(50px);
}

#cube ol li:nth-child(2) {
  left: 150px;
  top: 50px;
  transform-origin: left;
  transform: translateZ(50px) rotateY(90deg);
  /* opacity: .7; */
}

#cube ol li:nth-child(3) {
  left: -50px;
  top: 50px;
  transform-origin: right;
  transform: translateZ(50px) rotateY(-90deg);
  /* opacity: .7; */
}

#cube ol li:nth-child(4) {
  left: 50px;
  top: 150px;
  transform-origin: top;
  transform: translateZ(50px) rotateX(-90deg);
  /* opacity: .7; */
}

#cube ol li:nth-child(5) {
  left: 50px;
  top: -50px;
  transform-origin: bottom;
  transform: translateZ(50px) rotateX(90deg);
  /* opacity: .7; */
}

#cube ol li:nth-child(6) {
  left: 50px;
  top: 50px;
  transform: translateZ(-50px);
  /* opacity: .7; */
}



/*外层盒子鼠标移入效果*/
/* 正面 */
#cube ul li:nth-child(1) {
  left: 0;
  top: 0;
  /* opacity: .4; */
  transform: translateZ(100px);
}
#cube:hover ul li:nth-child(1) {
  transform: translateZ(200px) scale(1.5);
  /* opacity: .6; */
}
/* 右边 */
#cube ul li:nth-child(2) {
  left: 100px;
  top: 0;
  transform-origin: center;
  transform: rotateY(90deg);
  /* opacity: .4; */
}
#cube:hover ul li:nth-child(2) {
  transform: rotateY(90deg) translateZ(100px) scale(1.5);
  /* opacity: .6; */
}
/* 左边 */
#cube ul li:nth-child(3) {
  left: -100px;
  top: 0;
  transform-origin: center;
  transform: rotateY(-90deg);
  /* opacity: .4; */
}
#cube:hover ul li:nth-child(3) {
  transform: rotateY(-90deg) translateZ(100px) scale(1.5);
  /* opacity: .6; */
}
/* 底部 */
#cube ul li:nth-child(4) {
  left: 0;
  top: 100px;
  transform-origin: center;
  transform: rotateX(-90deg);
  /* opacity: .4; */
}
#cube:hover ul li:nth-child(4) {
  transform: rotateX(-90deg) translateZ(100px) scale(1.5);
  /* opacity: .6; */
}
/* 上面 */
#cube ul li:nth-child(5) {
  left: 0;
  top: -100px;
  transform-origin: center;
  transform: rotateX(90deg);
  /* opacity: .4; */
}
#cube:hover ul li:nth-child(5) {
  transform: rotateX(90deg) translateZ(100px) scale(1.5);
  /* opacity: .6; */
}
/* 后面 */
#cube ul li:nth-child(6) {
  left: 0;
  top: 0;
  transform: translateZ(-100px) rotate(180deg);
  /* opacity: .4; */
}
#cube:hover ul li:nth-child(6) {
  transform: rotate(180deg) translateZ(-200px) scale(1.5);
  /* opacity: .6; */
}

/*旋转动画效果*/

@keyframes rotate1 {
  0% {
    transform: rotateY(0);
  }
  100% {
    transform: rotateY(360deg);
  }
}